﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/SystemManagers/SystemManagers.master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="ViewRes" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%:SharedStrings.TitleHome%>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptsContent" runat="server">
<script>

    $(function () {
        $("#LevelsSelect").change(function () {
            var level = $(this).val();
            if (level == "")
                return false;
            levelId = level;
            loadPlaningsControlLink = '<%:Url.RouteUrl("Default", new {controller = "GlobalTasksCompletions", action = "GetAll", })%>?';

            $("#checkpointsCompletionTable").load(loadPlaningsControlLink + 'levelId=' + levelId, function () {

            });

        });
    });
//    function levelSelected() {
//        alert('kuku');
//                var level = $(this).val();
//                if (level == "")
//                    return false;
//                var levelId = level;
//                var  loadCheckPointsTableLink = '<%:Url.RouteUrl("Default", new { controller = "GlobalTasksCompletions", action = "GetAll" })%>';

//                $("#checkpointsCompletionTable").load(loadCheckPointsTableLink, function () {
//            });
//        };
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div style="margin: 1em auto; position: relative; text-align: left; width: 763px;">
        <span>
            <%:SystemManagersStrings.Level%></span>
        <select id="LevelsSelect">
            <option>
                <%:SystemManagersStrings.ChooseLevel%></option>
            <%
                foreach (var level in (IEnumerable<QualificationLevel>)ViewData["Levels"])
                {%>
            <option value="<%:level.QualificationLevelId%>">
                <%:level.ToString()%></option>
            <%
                     }%>
        </select>
    </div>
<%--<span>
        <%:Html.DropDownList("QualificationLevelId", (IEnumerable<SelectListItem>) ViewData["Levels"],
                                                        new { onchange = "levelSelected()" })%>
</span>--%>
<div id="checkpointsCompletionTable">
</div>  
<%--    <% Html.RenderAction("GetAll","GlobalTasksCompletions"); %>--%>
</asp:Content>


